package com.liaogui.producer.userinfo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liaogui.common.entity.userinfo.UserInfoEntity;
import com.liaogui.common.utils.PageUtils;
import com.liaogui.common.utils.Query;

import com.liaogui.common.service.userinfo.UserInfoService;
import com.liaogui.producer.userinfo.mapper.UserInfoDao;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import org.springframework.transaction.annotation.Transactional;


import java.util.Map;


@Service(timeout = 3000)
@Component
@Transactional
public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfoEntity> implements UserInfoService {
    @Autowired
    protected UserInfoDao userInfoDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<UserInfoEntity> page = this.page(
                new Query<UserInfoEntity>().getPage(params),
                new QueryWrapper<UserInfoEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public UserInfoEntity selectUserInfo(String phone) {
        return userInfoDao.selectUserInfo(phone);
    }

}